package com.usian.admin.controller;

import com.usian.admin.service.AdSensitiveService;
import com.usian.apis.admin.AdSensitiveControllerApi;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements AdSensitiveControllerApi {
    @Autowired
    private AdSensitiveService adSensitiveService;

    /**
     * 展示
     *
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult findList(@RequestBody SensitiveDto dto) {
        return adSensitiveService.findList(dto);
    }

    /**
     * 添加
     *
     * @param adSensitive
     * @return
     */
    @PostMapping("add")
    public ResponseResult add(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.add(adSensitive);
    }

    /**
     * 修改
     *
     * @param adSensitive
     * @return
     */
    @PostMapping("update")
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.update(adSensitive);
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @DeleteMapping("/del/{id}")
    public ResponseResult del(@PathVariable("id") Integer id) {
        return adSensitiveService.del(id);
    }


}
